package cc.shacocloud.redis.study.lock;

import lombok.Getter;

import java.util.Date;

@Getter
public class MutexLockMo {

    /**
     * 锁名称
     */
    private final String lockName;

    /**
     * 可重入凭证
     */
    private final String reentrantCertificate;

    /**
     * 过期时间，如果锁获取成功则为当前锁的过期时间，如果锁获取失败则为已经被占有锁的过期时间
     */
    private final Date expireDate;

    /**
     * 获取锁时返回true上锁成功反之则失败
     * or
     * 释放锁时返回true解锁成功反之则失败
     */
    private final boolean status;

    public MutexLockMo(String lockName, String reentrantCertificate, Date expireDate, boolean status) {
        this.lockName = lockName;
        this.reentrantCertificate = reentrantCertificate;
        this.expireDate = expireDate;
        this.status = status;
    }
}
